//Copyright (c) 2006-2007 Microsoft Corporation.  All rights reserved
using System;

namespace InvocationFramework.Common.Library
{
    /// <summary>
    /// Helper para obbtener informacion sobre el sistema operativo
    /// </summary>
    internal static class OSHelper
    {
        #region Properties
		
        /// <summary>
        /// Devuelve true si el sistema operativo es Windows 2003 o superior
        /// </summary>
        public static bool IsWin2003
        {
            get
            {
                return Environment.OSVersion.Platform == PlatformID.Win32NT && 
                       Environment.OSVersion.Version.Major >= 5 && 
                       Environment.OSVersion.Version.Minor >= 2;
            }
        }

        /// <summary>
        /// Devuelve true si el sistema operativo es Windows XP o superior
        /// </summary>
        public static bool IsWinXP
        {
            get
            {
                return Environment.OSVersion.Platform == PlatformID.Win32NT && 
                       Environment.OSVersion.Version.Major == 5 && 
                       Environment.OSVersion.Version.Minor == 1;
            }
        }

        /// <summary>
        /// Devuelve true si el COM+ es version 1.5 o superior (Windows 2003/XP)
        /// </summary>
        public static bool IsComPlus15
        {
            get
            {
                return Environment.OSVersion.Platform == PlatformID.Win32NT &&
                       Environment.OSVersion.Version.Major >= 5 &&
                       ( Environment.OSVersion.Version.Minor >= 2 || ( Environment.OSVersion.Version.Minor == 1 && Environment.OSVersion.ServicePack == "Service Pack 2" ) );
            }
        }

	    #endregion
    }
}